package sort;

/**
 * BubbleSort
 *
 * @author admin
 * @version 2023/11/02 10:12
 **/
public class BubbleSort implements SortStrategy{
    @Override
    public void sort(int[] a) {
        for(int i=0;i<a.length;i++) {
            for (int j = 0; j < a.length - i - 1; j++) {
                if (a[j] > a[j + 1]) {
                    swap(j, j + 1, a);
                }
            }
        }
    }
}
